home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #40 (Jan 89) / Help.sit / DoHelp.Asm next >
Assembly Source File  |  1988-10-21  |  30KB  |  1,363 lines

  1. ;-------------------------------------------------------------
  2. ;FileName:  DoHelp.Asm
  3. ;(C) 1988 by John Holder
  4. ;-------------------------------------------------------------
  5. ;What it does:
  6. ;A generic Help routine:
  7. ;Allows user to click in a list of names (these names are 
  8. ;actually the names of 'help' resources), and show the data
  9. ;contained in this resource (ACSII text), in a scrollable
  10. ;window.  Nothing about the dialog (other than its id#) is
  11. ;known, so the dialog can be modified without changing this
  12. ;code.  To make topics for your help routine, just create
  13. ;NAMED resources of type 'help' (lowercase) in your
  14. ;application starting at id#1 and making each id# one more
  15. ;than the last one.  To create the appearance of subtopics
  16. ;just add a few spaces to the beginning of the names of 
  17. ;the appropriate 'help' resources.
  18.  
  19. ;To use this in your application, just make sure you:
  20. ;XREF   DoHelp
  21. ;at the beginning of your source code and you call it by
  22. ;doing a:
  23. ;    BSR      DoHelp
  24. ;in the appropriate place in your code
  25.  
  26.  
  27. Include     Traps.D            ; Traps
  28. Include     ToolEqu.D        ; ToolBox equates
  29. Include        SysEqu.D        ; System equates
  30. Include        FSEqu.D            ; File equates
  31. Include        PackMacs.Txt        ; PACKage mgr equates
  32. Include     QuickEqu.D        ; QDraw equates
  33.  
  34.  
  35. MACRO    SaveRegs    =
  36.     MOVEM.L        A0-A4/D0-D7,-(SP)
  37.     |
  38.  
  39. MACRO    RestoreRegs    =
  40.     MOVEM.L        (SP)+,A0-A4/D0-D7
  41.     |
  42.  
  43.  
  44. true        equ    $0100
  45. false        equ    0
  46. nil        equ    0
  47.  
  48. arraycolumns    equ    1
  49. arrayrows    equ    0
  50.  
  51. celldepth    equ    16   ;depth of Cells in List
  52.  
  53. modify        EQU    14   ;State of keys and button
  54. message        equ    2    ;Message returned in EventRecord
  55.  
  56. DialogID    equ    2000 ;res id# of DLOG resource
  57.  
  58.  
  59.  
  60. XDEF    DoHelp            ;Define function DoHelp for Linker
  61.  
  62.  
  63. ;-------------------------------------------------------------
  64. ;    <<<< The beginning of the DoHelp routine >>>>
  65. ;-------------------------------------------------------------
  66. DoHelp
  67.     saveregs
  68.  
  69.     CLR.L        -(SP)            ;space for ptr
  70.     move.w        #DialogID,-(sp)
  71.     CLR.L        -(SP)            ;wstorage
  72.     MOVE.L        #-1,-(SP)
  73.     _GetNewDialog
  74.     MOVE.L        (SP),DialogPtr(A5)    ;save ptr
  75.     _SetPort
  76.  
  77.     ;set up stack for my routine
  78.     move.l        DialogPtr(A5),-(sp)
  79.     move        #1,-(sp)
  80.     bsr        HilightDialogButton
  81.  
  82.     ;Set up list of all 'help' resources
  83.     bsr        SetUpHelpList
  84.  
  85.     _InitCursor
  86.  
  87.  
  88. Dialog_Loop
  89.     pea         DialogsFilter    ;use filter to watch 
  90.     pea        ItemNumber(A5)    ;for List mgr events
  91.     _ModalDialog
  92.  
  93. WhatsTheHaps21
  94.     ;which item was clicked
  95.     cmp.w        #1,ItemNumber(A5)
  96.     beq        Quit_Help    ;click in 'Done..' but
  97.  
  98.     bra        Dialog_Loop    ;loop until done
  99.  
  100.  
  101. Quit_Help
  102.     ;all done, lets get outta here!
  103.     ;dispose of the List handle
  104.     move.l        ListHandle(A5),-(sp)
  105.     _LDispose
  106.  
  107.     ;kill the dialog
  108.     move.l        DialogPtr(A5),-(sp)
  109.     _DisposDialog
  110.  
  111.     ;return to calling application!
  112.     restoreregs
  113.     rts
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120. ;-------------------------------------------------------------
  121. ;<< Dialog Filter to watch for list selections in User Item >>
  122. ;-------------------------------------------------------------
  123. DialogsFilter
  124. ;this routine expects parameters to be on the stack (handled
  125. ;by _ModalDialog)
  126. ;PROCEDURE    
  127. ;DialogsFilter     (thedialog:dialogptr;VAR theEvent:EventRecord
  128. ;          VAR itemhit:integer): boolean
  129.  
  130.  
  131.     Parambytes    SET    12
  132.     tItemHit    SET    8    ;a ptr to an int!
  133.     tEvent        SET    12    ;event rec
  134.     tDialog        SET    16    ;dialog ptr
  135.     result        SET    20    ;result returned
  136.  
  137.     iPoint        SET    -4    ;mouse point
  138.     itype        SET    -6    ;item type
  139.     iHdl        SET    -10    ;item hand
  140.     iBox        SET    -18    ;item rect
  141.     localbytes    SET    -18
  142.  
  143.     link        A6,#localbytes
  144.     saveregs
  145.  
  146.     ;get User Item info (rect)
  147.     move.l        tDialog(A6),-(sp)
  148.     move        #2,-(sp)
  149.     pea        iType(A6)
  150.     pea        iHdl(A6)
  151.     pea        iBox(A6)
  152.     _GetDItem
  153.  
  154.     move.l        tevent(A6),A0
  155.     move        evtnum(A0),D0
  156.     cmp        #KeyDwnEvt,D0       ;was it a key down?
  157.     beq        CheckForEnterorReturn    ;yep!
  158.  
  159.     move.l        tevent(A6),A0
  160.     move        evtnum(A0),D0
  161.     cmp        #mButDwnEvt,D0     ;was it a mouse down?
  162.     bne        LetDialogHandleIt     ;if not, let
  163.                           ;_ModalDialog 
  164.                           ;handle
  165.  
  166.     ;was it a mouse click in the List Box (User Item)?
  167.     lea        evtMouse(A0),A0
  168.     lea        iPoint(A6),A1
  169.     move.l        (A0)+,(A1)+
  170.  
  171.     pea        iPoint(A6)
  172.     _GlobalToLocal
  173.  
  174.     clr        -(sp)
  175.     move.l        iPoint(A6),-(sp)
  176.     pea        iBox(A6)
  177.     _PtInRect
  178.     move        (sp)+,D0
  179.     beq        LetDialogHandleIt  ;not in user item
  180.  
  181.     bsr        HandleListEvent       ;handle list event!
  182.  
  183.     ;we've taken care of the event
  184.     move.l        tItemHit(A6),A0
  185.     move        #nil,(A0)       ;set itemhit to nil
  186.  
  187.     move        #true,result(A6)   ;stop _ModalDialog 
  188.     bra        FilterExit       ;from handling!
  189.  
  190. LetDialogHandleIt
  191.     move        #nil,result(A6)
  192.  
  193. FilterExit
  194.     ;restore stack to the way it was before
  195.     ;and return
  196.     restoreregs
  197.     unlk        A6
  198.     move.l        (sp)+,A0
  199.     adda        #parambytes,SP
  200.     jmp        (A0)        ;rts
  201.  
  202.  
  203.  
  204. ;-------------------------------------------------------------
  205. ;     <<<< Check for Return or Enter key press >>>>
  206. ;-------------------------------------------------------------
  207. CheckForEnterorReturn
  208. ;if the Enter or Return key was pushed, set the itemhit to #1
  209. ;and set result to false so it will be handled by _ModalDialog
  210.  
  211.     move.l        tevent(A6),A0
  212.     move.l        message(A0),D0
  213.  
  214.     cmp.b        #$0d,D0            ;return key?
  215.     beq        SetResult        ;yep!
  216.     cmp.b        #$03,D0            ;Enter key?
  217.     beq        SetResult        ;yep!
  218.     bra        LetDialogHandleIt    ;neither key
  219.  
  220. SetResult
  221.     move.l        tItemHit(A6),A0
  222.     move        #1,(A0)           ;set itemhit to 1
  223.     move        #true,result(A6)   ;let _ModalDialog
  224.                        ;handle it
  225.     bra        FilterExit
  226.  
  227.  
  228.  
  229.  
  230. ;-------------------------------------------------------------
  231. ;        <<<< Click in List box! >>>>
  232. ;-------------------------------------------------------------
  233. ;handle a click in the list box area
  234. HandleListEvent
  235.  
  236.     ;_LClick will handle scrolling & selection of list
  237.     ;items
  238.     pea        iPoint(A6)
  239.     _GetMouse
  240.     clr        -(sp)
  241.     move.l        iPoint(A6),-(sp)
  242.     move        tEvent+Modify(A6),-(sp)
  243.     move.l        listhandle(A5),-(sp)
  244.     _LClick
  245.     move        (sp)+,D0
  246.  
  247.     clr.l        TheCell(A5)       ;start at cell 0,0
  248.                        ;for _LGetSelect
  249.     clr        -(sp)
  250.     move        #true,-(sp)
  251.     pea        TheCell(A5)
  252.     move.l        listhandle(A5),-(sp)
  253.     _LGetSelect
  254.     move        (sp)+,D0
  255.     beq        Click_Not_In_Cell  ;no cell selected
  256.  
  257.     ;unselect the selected cell
  258.     move        #false,-(sp)
  259.     move.l        TheCell(A5),-(sp)
  260.     move.l        listhandle(A5),-(sp)
  261.     _LSetSelect
  262.  
  263.     ;de-activate the list
  264.     move        #false,-(sp)
  265.     move.l        listhandle(A5),-(sp)
  266.     _LActivate
  267.  
  268.     bsr        Erase_Rect       ;clear topic list
  269.     bsr        Set_To_DoneViewing ;change button name
  270.     bsr        GetandSetWatch       ;show watch cursor
  271.     bsr        Do_Help_View       ;show text from 
  272.                        ;'help' res
  273.  
  274.     ;re-activate the list
  275.     move        #true,-(sp)
  276.     move.l        listhandle(A5),-(sp)
  277.     _LActivate
  278.  
  279. Click_Not_In_Cell    
  280.     rts
  281.  
  282.  
  283.  
  284. ;-------------------------------------------------------------
  285. ;     <<<< Show the user selected help text >>>>
  286. ;-------------------------------------------------------------
  287. ;open the named resource and view its contents
  288. Do_Help_View
  289.  
  290.     ;Use all of rect except enough room for scroll bar
  291.     ;for text window
  292.     bsr        Get_Rect_Of_Item
  293.     lea        DispRect(A5),A2
  294.     sub        #16,Right(A2)
  295.  
  296.     ;create new Text edit record
  297.     clr.l        -(sp)
  298.     pea        DispRect(A5)
  299.     pea        DispRect(A5)
  300.     _TENew
  301.     move.l        (sp)+,TextHand(A5)    ;store handle
  302.  
  303.     ;set TE rec. text to 9 point Monaco
  304.     move.l        TextHand(A5),A1
  305.     move.l        (A1),A1
  306.     move        #9,teSize(A1)        ;Text Size!
  307.  
  308.     move.l        TextHand(A5),A1
  309.     move.l        (A1),A1
  310.     move        #Monaco,teFont(A1)    ;Text Font!
  311.  
  312.     bsr        Frame_The_Rect
  313.  
  314.     bsr        Get_Rect_Of_Item
  315.  
  316.     ;figure rectangle for scroll bar!
  317.     lea        DispRect(A5),A2
  318.     move        Right(A2),D2
  319.     sub        #15,D2        ;scroll bar width
  320.     move        D2,Left(A2)    ;left = right - 15
  321.     add        #1,Right(A2)    ;right = right + 1
  322.                     ;we de because the
  323.                     ;text rect is 1
  324.                     ;pixel inside the 
  325.                     ;User Item's rect
  326.  
  327.     pea        DispRect(A5)    ;expand top & bottom 
  328.     move        #0,-(sp)    ;of rect by 1 pixel
  329.     move        #-1,-(sp)
  330.     _InsetRect
  331.  
  332.     ;create scroll bar!
  333.     clr.l        -(sp)
  334.     move.l        DialogPtr(A5),-(sp)
  335.     pea        DispRect(A5)    ;scrolls rect
  336.     move.l        #nil,-(sp)
  337.     move        #true,-(sp)    ;visible
  338.     move        #0,-(sp)    ;init value
  339.     move        #0,-(sp)    ;min value
  340.     move        #0,-(sp)    ;max value(start at 0)
  341.     move        #16,-(sp)    ;proc id (16=scroll)
  342.     clr.l        -(sp)        ;refCon
  343.     _NewControl
  344.     move.l        (sp)+,ScrollHand(A5) ;save handle
  345.  
  346.     move        #255,DataLength(A5)  ;max length of 
  347.                          ;data allowed
  348.     ;Get the selected cells data
  349.     lea        AString(A5),A0         ;pt to byte after
  350.     add.l        #1,A0             ;length byte
  351.     move.l        A0,-(sp)         ;put ptr on stack
  352.     pea        DataLength(A5)       ;data length var
  353.     move.l        TheCell(A5),-(sp)
  354.     move.l        ListHandle(A5),-(sp)
  355.     _LGetCell
  356.  
  357.     ;add length of data to String ptr
  358.     lea        ASTring(A5),A0
  359.     move        DataLength(A5),D0
  360.     move.b        D0,(A0)
  361.  
  362.     ;get the res. & load it
  363.     clr.l        -(sp)
  364.     move.l        #'help',-(sp)
  365.     pea        AString(A5)
  366.     _GetNamedResource
  367.     move.l        (sp),ResHand(A5)
  368.     _LoadResource
  369.  
  370.     ;just to make sure the resource exists!
  371.     move.l        ResHand(A5),A0
  372.     cmp.l        #nil,A0        ;does res. exist?
  373.     bne        A_Ok        ;yep,it's there, go on
  374.     bsr        DumpStuff    ;no such resource!
  375.     rts                ;return
  376.  
  377. A_Ok
  378.     move.l        ResHand(A5),A0        ;lock handle
  379.     _HLock
  380.  
  381.     ;size of handle (text data)
  382.     move.l        ResHand(A5),A0
  383.     _GetHandleSize
  384.     move.l        D0,D2         ;D2 = length of text data
  385.  
  386.     ;set up Text Edit Record to use 'help' data
  387.     move.l        ResHand(A5),A0           ;need text ptr
  388.     move.l        (A0),-(sp)           ;convert handle
  389.     move.l        D2,-(sp)           ;text length
  390.     move.l        TextHand(A5),-(sp)
  391.     _TESetText
  392.  
  393.     move.l        ResHand(A5),A0           ;unlock handle
  394.     _HUnLock
  395.  
  396.     ;see how many lines of text are in the 
  397.     ;'help' data
  398.     move.l        TextHand(A5),A1
  399.     move.l        (A1),A1
  400.     move        tenLines(A1),d3       ;D3= lines of text!
  401.  
  402.     ;see how many lines fit into rect of user 
  403.     ;item of dialog box
  404.     bsr        Calc_Lines_In_One_Windowful
  405.     move        LinesInWind(A5),D1
  406.     sub        D1,D3           ;sub enough for a
  407.     cmp        #nil,D3           ;window full!
  408.     ble        Wont_Pass_Bottom   ;not enough lines 
  409.                        ;to adda scroll bar
  410.  
  411.     ;set the scroll bars max value by the # of lines
  412.     move.l        ScrollHand(A5),-(sp)
  413.     move        D3,-(sp)       ;# of lines
  414.     _SetMaxCtl
  415.  
  416. Wont_Pass_Bottom
  417.     ;update the text
  418.     pea        DispRect(A5)
  419.     move.l        TextHand(A5),-(sp)
  420.     _TEUpDate
  421.  
  422.     _InitCursor
  423.  
  424.     ;go watch for text events
  425.     bsr        HandleTextEditDialogEvent
  426.  
  427.     rts        ;done with the text, return
  428.  
  429.  
  430.  
  431.  
  432. ;-------------------------------------------------------------
  433. ;<<<< Handle events in Dialog box (with text scrolling)! >>>>
  434. ;-------------------------------------------------------------
  435. HandleTextEditDialogEvent
  436.     saveregs
  437.  
  438. D_Loop
  439.     pea        CheckTextScroll      ;filter to watch
  440.     pea        ItemNumber(A5)      ;for text scrolling
  441.     _ModalDialog
  442.  
  443.     ;check which buttons are clicked here
  444.     cmp.w        #1,ItemNumber(A5)
  445.     beq        Done_With_This      ;done viewing text
  446.  
  447.     ;if ItemNumber(A5) = 2, that means the user
  448.     ;clicked in the content of the text of the dialog
  449.     ;which is handled the same as clicked the 
  450.     ;'Done Viewing' button
  451.     cmp.w        #2,ItemNumber(A5)
  452.     beq        Done_With_This      ;done viewing text
  453.     bra        D_Loop          ;keep looping
  454.  
  455.  
  456.  
  457. ;-------------------------------------------------------------
  458. ;        <<<< Finished here with text view >>>>
  459. ;-------------------------------------------------------------
  460. Done_With_This
  461.     bsr        DumpStuff
  462.     restoreregs
  463.     rts
  464.  
  465.  
  466.  
  467. ;-------------------------------------------------------------
  468. ;         <<<< Dump TE rec. & scroll bar >>>>
  469. ;-------------------------------------------------------------
  470. DumpStuff
  471.     ;dispose of text edit record
  472.     move.l        TextHand(A5),-(sp)
  473.     _TEDispose
  474.  
  475.     ;dispose of Scroll bar
  476.     move.l        ScrollHand(A5),-(sp)
  477.     _DisposControl
  478.  
  479.     bsr        Erase_Rect    ;erase the rect
  480.  
  481.     ;reset text font & size to System values
  482.     move        #12,-(sp)    ;12 point
  483.     _TextSize
  484.  
  485.     move        #0,-(sp)    ;Use System Font
  486.     _TextFont
  487.  
  488.     ;re-show the list by causing list update
  489.     MOVE.L        DialogPtr(A5),A1
  490.     move.l        24(A1),-(sp)
  491.     move.l        ListHandle(A5),-(sp)
  492.     _LUpdate
  493.  
  494.     bsr        Frame_The_Rect    ;re-frame list rect
  495.  
  496.     bsr        Set_To_DoneWithHelp
  497.     rts
  498.  
  499.  
  500.  
  501. ;-------------------------------------------------------------
  502. ;    <<<< Dialog Filter to watch for text scrolling >>>>
  503. ;-------------------------------------------------------------
  504. CheckTextScroll
  505. ;this routine expects parameters to be on the stack (set up
  506. ;by _ModalDialog)
  507. ;PROCEDURE    
  508. ;CheckTextScroll (thedialog:dialogptr;VAR theEvent:EventRecord
  509. ;         VAR itemhit:integer): boolean
  510.  
  511.  
  512.     Parambytes    SET    12
  513.     tItemHit    SET    8    ;a ptr to an int!
  514.     tEvent        SET    12    ;event rec
  515.     tDialog        SET    16    ;dialog ptr
  516.     result        SET    20    ;result returned
  517.  
  518.     iPoint        SET    -4    ;mouse point
  519.     itype        SET    -6    ;item type
  520.     iHdl        SET    -10    ;item hand
  521.     iBox        SET    -18    ;item rect
  522.     PartCode    set    -20    ;used for scroll
  523.     localbytes    SET    -20
  524.  
  525.     link        A6,#localbytes
  526.     saveregs
  527.  
  528.     move.l        tDialog(A6),-(sp)
  529.     move        #2,-(sp)
  530.     pea        iType(A6)
  531.     pea        iHdl(A6)
  532.     pea        iBox(A6)
  533.     _GetDItem
  534.     
  535.     ;only rect in user item will be scroll bar that
  536.     ;this dialog filter handles
  537.     lea        iBox(A6),A2
  538.     move        Right(A2),D2
  539.     sub        #16,D2        ;scroll bar width
  540.     move        D2,Left(A2)    ;left = right - 16
  541.  
  542.     move.l        tevent(A6),A0
  543.     move        evtnum(A0),D0
  544.     cmp        #KeyDwnEvt,D0       ;was it a key down?
  545.     beq        CheckForEnterorReturn2    ;yep!
  546.  
  547.     move.l        tevent(A6),A0
  548.     move        evtnum(A0),D0
  549.     cmp        #mButDwnEvt,D0     ;was it a mouse down?
  550.     bne        LetDialogHandleIt2    ;if not, let
  551.                           ;_ModalDialog 
  552.                           ;handle
  553.  
  554.     ;change mouse pt into local coordinates
  555.     lea        evtMouse(A0),A0
  556.     lea        iPoint(A6),A1
  557.     move.l        (A0)+,(A1)+
  558.  
  559.     pea        iPoint(A6)
  560.     _GlobalToLocal
  561.  
  562.     ;was it a mouse click in the Text Box scroll 
  563.     ;bar (User Item)?    
  564.     clr        -(sp)
  565.     move.l        iPoint(A6),-(sp)
  566.     pea        iBox(A6)
  567.     _PtInRect
  568.     move        (sp)+,D0
  569.     beq        LetDialogHandleIt2  ;not in scroll,  
  570.                         ;let dialog handle
  571.  
  572.     bsr        HandleScroll        ;go handle text 
  573.                         ;scroll event!
  574.  
  575.     ;we've taken care of the event
  576.     move.l        tItemHit(A6),A0
  577.     move        #nil,(A0)      ;set itemhit to nil
  578.  
  579.     move        #true,result(A6)  ;set result to true,  
  580.     bra        FilterExit2      ;stop _ModalDialog
  581.                       ;from handling
  582.  
  583.  
  584. LetDialogHandleIt2
  585.     move        #nil,result(A6)      ;set to nil, let 
  586.                       ;_ModalDialog handle
  587.                       ;it
  588. FilterExit2
  589.     ;get out of the routine here!
  590.     restoreregs
  591.     unlk        A6
  592.     move.l        (sp)+,A0
  593.     adda        #parambytes,SP
  594.     jmp        (A0)            ;rts
  595.  
  596.  
  597. ;-------------------------------------------------------------
  598. ;     <<<< Check for Return or Enter key press >>>>
  599. ;-------------------------------------------------------------
  600. CheckForEnterorReturn2
  601. ;if the Enter or Return key was pushed set the itemhit to #1
  602. ;and set result to false so it will be handled!
  603.  
  604.     move.l        tevent(A6),A0
  605.     move.l        message(A0),D0
  606.  
  607.     cmp.b        #$0d,D0            ;return key?
  608.     beq        SetResult2        ;yep!
  609.     cmp.b        #$03,D0            ;Enter key?
  610.     beq        SetResult2        ;yep!
  611.     bra        LetDialogHandleIt2    ;neither key
  612.  
  613. SetResult2
  614.     move.l        tItemHit(A6),A0
  615.     move        #1,(A0)             ;set itemhit to 1
  616.     move        #true,result(A6)     ;let modaldialog
  617.     bra        FilterExit2         ;handle it
  618.  
  619.  
  620.  
  621.  
  622. ;-------------------------------------------------------------
  623. ;-------------------------------------------------------------
  624. ;        <<<< ALL text scrolling routines >>>>
  625. ;-------------------------------------------------------------
  626. ;-------------------------------------------------------------
  627.  
  628. ;-------------------------------------------------------------
  629. ;         <<<< Click in Text Scroll bar >>>>
  630. ;-------------------------------------------------------------
  631. HandleScroll
  632.     pea        iPoint(A6)
  633.     _GetMouse
  634.  
  635.     clr        -(sp)
  636.     move.l        iPoint(A6),-(sp)
  637.     move.l        DialogPtr(A5),-(sp)
  638.     pea        WhichControl(A5)
  639.     _FindControl
  640.     move        (sp)+,PartCode(A6)
  641.     beq        ScrollDone       ;not in any control
  642.  
  643.     ;was click in the scroll bar?
  644.     ;compare value returned by _FindControl & the
  645.     ;scrolls handle we have stored, if they are
  646.     ;equal then do the scroll routines
  647.     move.l        ScrollHand(A5),D0
  648.     move.l        WhichControl(A5),D1
  649.     cmp.l        D0,D1
  650.     beq        Click_In_Scroll
  651.     bra        ScrollDone      ;click not in scroll
  652.  
  653.  
  654. Click_In_Scroll
  655.     ;which part of scroll?
  656.     cmp        #inUpButton,PartCode(A6)
  657.     beq        DoUpSCroll
  658.     cmp        #inDownButton,PartCode(A6)
  659.     beq        DoDownSCroll
  660.     cmp        #inPageUp,PartCode(A6)
  661.     beq        DoPageUpSCroll
  662.     cmp        #inPageDown,PartCode(A6)
  663.     beq        DoPageDownSCroll
  664.     cmp        #inThumb,PartCode(A6)
  665.     beq        DoThumb
  666.     bra        ScrollDone
  667.  
  668.  
  669. ;handle different parts of scroll
  670. DoUpSCroll
  671.     clr        -(sp)
  672.     move.l        WhichControl(A5),-(sp)
  673.     move.l        iPoint(A6),-(sp)
  674.     pea        UpActionProc
  675.     _TrackControl
  676.     move        (sp)+,D0
  677.     bra        ScrollDone
  678.  
  679. DoDownSCroll
  680.     clr        -(sp)
  681.     move.l        WhichControl(A5),-(sp)
  682.     move.l        iPoint(A6),-(sp)
  683.     pea        DownActionProc
  684.     _TrackControl
  685.     move        (sp)+,D0
  686.     bra        ScrollDone
  687.  
  688. DoPageUpSCroll
  689.     clr        -(sp)
  690.     move.l        WhichControl(A5),-(sp)
  691.     move.l        iPoint(A6),-(sp)
  692.     pea        PageUpActionProc
  693.     _TrackControl
  694.     move        (sp)+,D0
  695.     bra        ScrollDone
  696.  
  697. DoPageDownSCroll
  698.     clr        -(sp)
  699.     move.l        WhichControl(A5),-(sp)
  700.     move.l        iPoint(A6),-(sp)
  701.     pea        PageDownActionProc
  702.     _TrackControl
  703.     move        (sp)+,D0
  704.     bra        ScrollDone
  705.  
  706.  
  707. ;handle click in thumb of control
  708. DoThumb
  709.     clr        -(sp)
  710.     move.l        WhichControl(A5),-(sp)
  711.     _GetCtlValue
  712.     move        (sp)+,D4       ;D4 = old control value
  713.  
  714.     clr        -(sp)
  715.     move.l        WhichControl(A5),-(sp)
  716.     move.l        iPoint(A6),-(sp)
  717.     clr.l        -(sp)
  718.     _TrackControl
  719.     move        (sp)+,D0
  720.  
  721.     clr        -(sp)
  722.     move.l        WhichControl(A5),-(sp)
  723.     _GetCtlValue
  724.     move        (sp)+,D3     ;D3 = new cntl value
  725.  
  726.     sub        D3,D4         ;D4-D3=new view value
  727.     move        D4,D6
  728.     bsr        Scroll_The_Text     ;scroll text selected
  729.                      ;spot
  730.  
  731.     bra        ScrollDone
  732.  
  733.  
  734. ;return from HandleScroll
  735. ScrollDone
  736.     rts
  737.  
  738.  
  739.  
  740. ;-------------------------------------------------------------
  741. ;          <<<< Handle Up Scroll arrow >>>>
  742. ;-------------------------------------------------------------
  743. UpActionProc
  744.     ;offsets into A6 stack
  745.     thecontrol    set    10
  746.     pcode        set    8
  747.     parambytes    set    6
  748.  
  749.     link        A6,#0
  750.     saveregs
  751.  
  752.     tst        pcode(A6)
  753.     beq        UpActionDone
  754.  
  755.     clr        -(sp)
  756.     move.l        WhichControl(A5),-(sp)
  757.     _GetCtlValue
  758.     move        (sp)+,D1
  759.     beq        UpActionDone    ;do nothing if control
  760.                     ;value is already 0
  761.  
  762.     sub        #1,D1        ;sub 1 from scroll val
  763.  
  764.     move.l        WhichControl(A5),-(sp)
  765.     move        D1,-(sp)
  766.     _SetCtlValue            ;set to new value
  767.  
  768.     move        #1,D6          ;d6 = how many lines
  769.     bsr        Scroll_The_Text      ;to scroll!
  770.  
  771. UpActionDone
  772.     restoreregs
  773.     unlk        A6
  774.     move.l        (sp)+,A1
  775.     adda.w        #parambytes,SP
  776.     jmp        (a1)        ;rts
  777.  
  778.  
  779. ;-------------------------------------------------------------
  780. ;          <<<< Handle Down Scroll arrow >>>>
  781. ;-------------------------------------------------------------
  782. DownActionProc
  783.     ;offsets into A6 stack
  784.     thecontrol    set    10
  785.     pcode        set    8
  786.     parambytes    set    6
  787.  
  788.     link        A6,#0
  789.     saveregs
  790.  
  791.     tst        pcode(A6)
  792.     beq        DownActionDone
  793.  
  794.     clr        -(sp)
  795.     move.l        WhichControl(A5),-(sp)
  796.     _GetCtlValue
  797.     move        (sp)+,D2
  798.  
  799.     add        #1,D2        ;add 1 to scroll val
  800.  
  801.     clr        -(sp)
  802.     move.l        WhichControl(A5),-(sp)
  803.     _GetMaxCtl
  804.     move        (sp)+,D1
  805.  
  806.     ;don't scroll past controls max setting!
  807.     cmp        D1,D2
  808.     bgt        DownActionDone
  809.  
  810.     move.l        WhichControl(A5),-(sp)
  811.     move        D2,-(sp)
  812.     _SetCtlValue
  813.  
  814.     move        #-1,D6          ;d6 = how many lines
  815.     bsr        Scroll_The_Text      ;to scroll!
  816.  
  817. DownActionDone
  818.     restoreregs
  819.     unlk        A6
  820.     move.l        (sp)+,A1
  821.     adda.w        #parambytes,SP
  822.     jmp        (a1)        ;rts
  823.  
  824.  
  825.  
  826. ;-------------------------------------------------------------
  827. ;          <<<< Handle PageUp Scroll arrow >>>>
  828. ;-------------------------------------------------------------
  829. PageUpActionProc
  830.     ;offsets into A6 stack
  831.     thecontrol    set    10
  832.     pcode        set    8
  833.     parambytes    set    6
  834.  
  835.     link        A6,#0
  836.     saveregs
  837.  
  838.     tst        pcode(A6)
  839.     beq        PageUpActionDone
  840.  
  841.     clr        -(sp)
  842.     move.l        WhichControl(A5),-(sp)
  843.     _GetCtlValue
  844.     move        (sp)+,D1
  845.  
  846.     move        LinesInWind(A5),D0
  847.     sub        #1,D0
  848.     sub        D0,D1
  849.     move        D0,D6        ;d6 = how many lines
  850.                     ;to scroll!
  851.  
  852.     ;are we going to go before 1st line?
  853.     ;if so, figure how many lines from current position
  854.     ;until 0 (zero) and use that # to scroll text!
  855.     cmp        #nil,D1
  856.     bge        Not_Past_Begin2
  857.  
  858.     add        D1,D6        ;set to proper value
  859.                     ;for scroll
  860.     move        #nil,D1        ;to set ctrl
  861.  
  862. Not_Past_Begin2
  863.     move.l        WhichControl(A5),-(sp)
  864.     move        D1,-(sp)
  865.     _SetCtlValue
  866.  
  867.     bsr        Scroll_The_Text
  868.  
  869. PageUpActionDone
  870.     restoreregs
  871.     unlk        A6
  872.     move.l        (sp)+,A1
  873.     adda.w        #parambytes,SP
  874.     jmp        (a1)        ;rts
  875.  
  876.  
  877. ;-------------------------------------------------------------
  878. ;         <<<< Handle PageDown Scroll arrow >>>>
  879. ;-------------------------------------------------------------
  880. PageDownActionProc
  881.     ;offsets into A6 stack
  882.     thecontrol    set    10
  883.     pcode        set    8
  884.     parambytes    set    6
  885.  
  886.     link        A6,#0
  887.     saveregs
  888.  
  889.     tst        pcode(A6)
  890.     beq        PageDownActionDone
  891.  
  892.     clr        -(sp)
  893.     move.l        WhichControl(A5),-(sp)
  894.     _GetCtlValue
  895.     move        (sp)+,D7
  896.     move        D7,D2
  897.  
  898.     move        LinesInWind(A5),D0
  899.     sub        #1,D0
  900.     add        D0,D2
  901.     neg        D0
  902.     move        D0,D6        ;d6 = how many lines
  903.                     ;to scroll!
  904.  
  905.     ;are we going to go after last line?
  906.     ;if so, figure how many lines from current position
  907.     ;until last line and use that # to scroll text
  908.     clr        -(sp)
  909.     move.l        WhichControl(A5),-(sp)
  910.     _GetMaxCtl
  911.     move        (sp)+,D3    ;to set ctrl
  912.  
  913.     cmp        D3,D2
  914.     ble        Not_Past_End
  915.  
  916.     sub        D3,D7        ;set to proper value
  917.     move        D7,D6        ;for scroll
  918.     move        D3,D2        ;to set ctrl
  919.  
  920. Not_Past_End
  921.     move.l        WhichControl(A5),-(sp)
  922.     move        D2,-(sp)
  923.     _SetCtlValue
  924.  
  925.     bsr        Scroll_The_Text
  926.  
  927.  
  928. PageDownActionDone
  929.     restoreregs
  930.     unlk        A6
  931.     move.l        (sp)+,A1
  932.     adda.w        #parambytes,SP
  933.     jmp        (a1)        ;rts
  934.  
  935.  
  936.  
  937.  
  938. ;-------------------------------------------------------------
  939. ;         <<<< Do the actual text scrolling >>>>
  940. ;-------------------------------------------------------------
  941. Scroll_The_Text
  942.     ;d6 has how many lines and which direction to scroll
  943.     ;(depending on whether the value is pos. or neg.)
  944.     ;use teLineHite to figure how many pixels to scroll
  945.     ;by multiplying it with the amount of lines
  946.     clr.l        D2
  947.     move.l        TextHand(A5),A2
  948.     move.l        (A2),A2
  949.     move        teLineHite(A2),D2
  950.     muls        D6,D2
  951.  
  952.     move        #nil,-(sp)    ;no horiz. scroll
  953.     move        D2,-(sp)    ;vert. scroll
  954.     move.l        TextHand(A5),-(sp)
  955.     _TESCroll
  956.  
  957.     rts
  958.  
  959. ;-------------------------------------------------------------
  960. ;    <<<< END of all text scrolling routines >>>>
  961. ;-------------------------------------------------------------
  962.  
  963.  
  964.  
  965.  
  966. ;-------------------------------------------------------------
  967. ;   <<<< How many text lines can fit in user item rect >>>>
  968. ;-------------------------------------------------------------
  969. Calc_Lines_In_One_Windowful
  970.     saveregs
  971.  
  972.     bsr        Get_Rect_Of_Item
  973.  
  974.     clr.l        D4
  975.  
  976.     lea        DispRect(A5),A2
  977.     move        Top(A2),D3
  978.     move        Bottom(A2),D4
  979.     sub        D3,D4          ;Top-Bottom = how many 
  980.                       ;pixels in text view box
  981.                       ;D4= heighth (in pixels)
  982.                       ;of help window
  983.  
  984.     clr.l        D5
  985.     move.l        TextHand(A5),A2
  986.     move.l        (A2),A2
  987.     move        teLineHite(A2),D5  ;rect heighth
  988.     divu        D5,D4           ;divided by the
  989.                        ;heighth of one
  990.                        ;line of text =
  991.                        ;how many lines
  992.                        ;can fit!
  993.  
  994.     ;D4 now = how many lines of text can fit into one
  995.     ;screen of the user item of the dialog box!
  996.     move        D4,LinesInWind(A5)
  997.  
  998.     restoreregs
  999.     rts
  1000.  
  1001.  
  1002.  
  1003. ;-------------------------------------------------------------
  1004. ;    <<<< Erase inside of user item rect of dialog >>>>
  1005. ;-------------------------------------------------------------
  1006. Erase_Rect
  1007.     ;erase entire user item rectangle
  1008.     bsr        Get_Rect_Of_Item
  1009.  
  1010.     pea        DispRect(A5)
  1011.     _EraseRect
  1012.  
  1013.     rts
  1014.  
  1015.  
  1016.  
  1017. ;-------------------------------------------------------------
  1018. ;        <<<< Get user item rect of dialog >>>>
  1019. ;-------------------------------------------------------------
  1020. Get_Rect_Of_Item
  1021.     ;Get info from User Item #2
  1022.     move.l        DialogPtr(A5),-(SP)
  1023.     move        #2,-(sp)
  1024.     pea        ItemType(A5)
  1025.     pea        ItemHandle(A5)
  1026.     pea        DispRect(A5)
  1027.     _GetDItem
  1028.  
  1029.     rts
  1030.  
  1031.  
  1032.  
  1033. ;-------------------------------------------------------------
  1034. ;    <<<< Change button to say 'Done Viewing' >>>>
  1035. ;-------------------------------------------------------------
  1036. Set_To_DoneViewing
  1037.     bsr        Get_Button_Handle
  1038.     move.l        ItemHandle(A5),-(sp)
  1039.     pea        DoneViewing
  1040.     _SetCTitle
  1041.     rts
  1042.  
  1043.  
  1044. ;-------------------------------------------------------------
  1045. ;      <<<< Change button to say 'Done with Help' >>>>
  1046. ;-------------------------------------------------------------
  1047. Set_To_DoneWithHelp
  1048.     bsr        Get_Button_Handle
  1049.     move.l        ItemHandle(A5),-(sp)
  1050.     pea        DoneString
  1051.     _SetCTitle
  1052.     rts
  1053.  
  1054.  
  1055.  
  1056. ;-------------------------------------------------------------
  1057. ;        <<<< Get handle of button in dialog >>>>
  1058. ;-------------------------------------------------------------
  1059. Get_Button_Handle
  1060.     ;Get the buttons handle (for changing the buttons
  1061.     ;title)
  1062.     move.l        DialogPtr(A5),-(SP)
  1063.     move        #1,-(sp)
  1064.     pea        ItemType(A5)
  1065.     pea        ItemHandle(A5)
  1066.     pea        DispRect(A5)
  1067.     _GetDItem
  1068.     rts
  1069.  
  1070.  
  1071.  
  1072. ;-------------------------------------------------------------
  1073. ;      <<<< Get watch CURSor and display it >>>>
  1074. ;-------------------------------------------------------------
  1075. GetandSetWatch
  1076.     clr.l        -(sp)
  1077.     move        #watchcursor,-(sp)
  1078.     _GetCursor
  1079.     move.l        (sp)+,A0
  1080.     move.l        (A0),-(sp)
  1081.     _SetCursor
  1082.     rts
  1083.  
  1084.  
  1085.  
  1086. ;-------------------------------------------------------------
  1087. ;      <<<< Frame the user item rect of dialog >>>>
  1088. ;-------------------------------------------------------------
  1089. Frame_The_Rect
  1090.     ;frame the outside of the user items rectangle
  1091.     bsr        Get_Rect_Of_Item
  1092.     pea        DispRect(A5)          ;Inset rect by 1
  1093.     move        #-1,-(sp)          ;outward
  1094.     move        #-1,-(sp)
  1095.     _InSetRect
  1096.  
  1097.     pea        DispRect(A5)
  1098.     _FrameRect
  1099.     rts
  1100.  
  1101.  
  1102.  
  1103. ;-------------------------------------------------------------
  1104. ;         <<<< Hilight A Dialog Button >>>>
  1105. ;-------------------------------------------------------------
  1106. ;this routine expects parameters to be on the stack
  1107. ;PROCEDURE    HilightDialogButton (WPtr: Ptr; WhichItem: Int)
  1108. ;Will hilight a button in a dialog box
  1109. HilightDialogButton
  1110.     WindPt        SET    10
  1111.     WhichItem    SET    8
  1112.     parambytes    SET    6
  1113.  
  1114.     ;local variables
  1115.     TheType        SET    -4    ;Vars for _GetDItem
  1116.     TheHandle    SET    -8    ;handle
  1117.     TheRect        SET    -16    ;item rect
  1118.     localbytes    SET    -16    ;for link
  1119.  
  1120.     link        A6,#localbytes
  1121.     saveregs
  1122.  
  1123.     move.l        WindPt(A6),-(SP)
  1124.     _SetPort
  1125.  
  1126.     move.l        WindPt(A6),-(SP)
  1127.     move        WhichItem(A6),-(sp)
  1128.     pea        TheType(A6)
  1129.     pea        TheHandle(A6)
  1130.     pea        TheRect(A6)
  1131.     _GetDItem
  1132.  
  1133.     move        #3,-(sp)
  1134.     move        #3,-(sp)
  1135.     _PenSize
  1136.  
  1137.     pea        TheRect(A6)
  1138.     move        #-4,-(sp)
  1139.     move        #-4,-(sp)
  1140.     _InSetRect
  1141.  
  1142.     pea        TheRect(A6)
  1143.     move        #16,-(sp)
  1144.     move        #16,-(sp)
  1145.     _FrameRoundRect
  1146.  
  1147.     move        #1,-(sp)
  1148.     move        #1,-(sp)
  1149.     _PenSize
  1150.  
  1151.     restoreregs
  1152.     unlk        A6
  1153.     move.l        (sp)+,A0
  1154.     adda        #parambytes,SP
  1155.     jmp        (A0)        ;rts
  1156.  
  1157.  
  1158.  
  1159.  
  1160. ;-------------------------------------------------------------
  1161. ;     <<<< Set up the dialog box with the help info >>>>
  1162. ;-------------------------------------------------------------
  1163. SetUpHelpList
  1164.     saveregs
  1165.  
  1166.     bsr        Calc_Cell_Width
  1167.  
  1168.     bsr        Get_Rect_Of_Item
  1169.  
  1170.     ;must allow room for the lists scroll bar on the right
  1171.     ;side so subtract 15 from the rects right side!
  1172.     lea        DispRect(A5),A1
  1173.     sub        #15,right(A1)
  1174.  
  1175.     ;set up the arrayrect (for the cells rows and columns)
  1176.     ;for the List Mgr
  1177.     lea        arrayrect(A5),a0
  1178.     move.l        #0,(A0)+
  1179.     move        #arrayRows,(A0)+
  1180.     move        #arraycolumns,(A0)+
  1181.     move        #celldepth,D0
  1182.     swap        D0
  1183.     move        cellWidth(A5),D0
  1184.  
  1185.     ;create a new List
  1186.     clr.l        -(sp)
  1187.     pea        DispRect(A5)        ;list rect!
  1188.     pea        arrayrect(A5)
  1189.     move.l        D0,-(sp)        ;cell size
  1190.     move        #0,-(sp)        ;res id of proc.
  1191.     move.l        DialogPtr(A5),-(sp)    ;window ptr
  1192.     move.w        #false,-(sp)        ;draw it?
  1193.     move        #false,-(sp)        ;has grow?
  1194.     move        #false,-(sp)        ;horiz scroll?
  1195.     move        #true,-(sp)        ;vert scroll?
  1196.     _LNew
  1197.     move.l        (sp)+,ListHandle(A5)
  1198.  
  1199.     ;set selflags to allow only one selection at a time!
  1200.     move.l        ListHandle(A5),A0
  1201.     move.l        (A0),A0
  1202.     move.b        #128,selFlags(A0)
  1203.  
  1204.     ;put all the 'help' names (topics) into the list
  1205.     bsr        AddHelpNamesToList
  1206.  
  1207.     restoreregs
  1208.     rts
  1209.  
  1210.  
  1211.  
  1212. ;-------------------------------------------------------------
  1213. ;    <<<< Calculate cell width for list manager >>>>
  1214. ;-------------------------------------------------------------
  1215. Calc_Cell_Width
  1216.     bsr        Get_Rect_Of_Item
  1217.  
  1218.     move        DispRect+right(A5),D2
  1219.     move        DispRect+left(A5),D3
  1220.     sub        D3,D2
  1221.     sub        #16,D2            ;allow for scroll
  1222.  
  1223.     move        D2,cellwidth(A5)    ;return value
  1224.  
  1225.     rts
  1226.  
  1227.  
  1228.  
  1229. ;-------------------------------------------------------------
  1230. ;     <<<< Add 'help' resource names to List >>>>
  1231. ;-------------------------------------------------------------
  1232. AddHelpNamesToList
  1233. ;this is a routine to add all 'help' resource names 
  1234. ;to a list
  1235.  
  1236.     saveregs
  1237.  
  1238.     clr        -(sp)
  1239.     move.l        #'help',-(sp)
  1240.     _CountResources
  1241.     move        (sp)+,D4      ;how many there are
  1242.     move        D4,D7
  1243.     beq        None_Here      ;if no 'help' res's
  1244.                       ;here, quit!
  1245.     sub        #1,D4          ;sub 1 for looping
  1246.                       ;(the DBRA later)
  1247.  
  1248.     move        #false,-(sp)      ;set drawing off
  1249.     move.l        ListHandle(A5),-(sp)
  1250.     _LDoDraw
  1251.  
  1252.     move.l        #nil,TheCell(A5) ;start with zero cell
  1253.  
  1254.     ;set ResLoad off (so resources are not
  1255.     ;automatically read into memory)
  1256.     move        #false,-(sp)
  1257.     _SetResLoad
  1258.  
  1259. AddhelpLoop
  1260.     clr.l        -(sp)
  1261.     move.l        #'help',-(sp)
  1262.     move        D7,-(sp)    ;res. id #
  1263.     _GetResource
  1264.     move.l        (sp),A4        ;leave handle on stack 
  1265.                     ;for next routine
  1266.  
  1267.     ;get the resources name
  1268.     pea        ResId(A5)
  1269.     pea        ResType(A5)
  1270.     pea        ResName(A5)
  1271.     _GetResInfo
  1272.  
  1273.     lea        ResName(A5),A3
  1274.     clr.l        D3
  1275.     move.b        (A3)+,D3    ;how many chars in 
  1276.                     ;name for later
  1277.  
  1278.     sub        #1,D7        ;decrement index #
  1279.                     ;D7 = the res id#
  1280.  
  1281.     ;d3 = how many characters in string, 
  1282.     ;A3 = ptr to string data
  1283.     ;add a new row
  1284.     clr        -(sp)
  1285.     move        #1,-(sp)
  1286.     move        #0,-(sp)
  1287.     move.l        ListHandle(A5),-(sp)
  1288.     _LAddRow
  1289.     move        (sp)+,D0
  1290.  
  1291.     ;set the cells data to the resources name
  1292.     move.l        A3,-(sp)    ;points to name
  1293.     move        D3,-(sp)    ;how many chars?
  1294.     move.l        TheCell(A5),-(sp)
  1295.     move.l        ListHandle(A5),-(sp)
  1296.     _LSetCell
  1297.  
  1298.     dbra        D4,AddhelpLoop  ;loop until D4 = 0
  1299.  
  1300.     ;set ResLoad back on
  1301.     move        #true,-(sp)
  1302.     _SetResLoad
  1303.  
  1304.     move        #true,-(sp)    ;turn drawing on
  1305.     move.l        ListHandle(A5),-(sp)
  1306.     _LDoDraw
  1307.  
  1308.     ;update the list to show it
  1309.     MOVE.L        DialogPtr(A5),A1
  1310.     move.l        24(A1),-(sp)
  1311.     move.l        ListHandle(A5),-(sp)
  1312.     _LUpdate
  1313.  
  1314.     bsr        Frame_The_Rect
  1315.  
  1316. None_Here
  1317.     restoreregs
  1318.     rts
  1319.  
  1320.  
  1321.  
  1322.  
  1323. ;-------------------------------------------------------------
  1324. ;             <<<< Constants >>>>
  1325. ;-------------------------------------------------------------
  1326. DoneString    dc.b    14,'Done with Help'
  1327.         .align    2
  1328.  
  1329. DoneViewing    dc.b    12,'Done viewing'
  1330.         .align    2
  1331.  
  1332.  
  1333.  
  1334. ;-------------------------------------------------------------
  1335. ;          <<<< Global variables >>>>
  1336. ;-------------------------------------------------------------
  1337. WhichControl    ds.l    1    ;used by _FindControl
  1338. TextHand    ds.l    1    ;TE record Handle
  1339. ScrollHand    ds.l    1    ;Handle of scroll bar
  1340. DialogPtr    ds.l    1    ;Ptr to Help Dialog
  1341. LinesInWind    ds    1    ;how many text lines fit in rect
  1342. AString        ds.b    256  ;Space for a string
  1343.  
  1344. ListHandle    ds.l    1    ;Handle to list
  1345. TheCell        ds.l    1    ;Used by the List Mgr
  1346. ArrayRect    ds.l    2    ;Rows & columns for List Mgr
  1347. cellwidth    ds.w    1    ;width of cell in list
  1348. DataLength    ds.w    1    ;Var used by _LGetCell
  1349.  
  1350. ItemType    ds.l    1    ;Vars used by _GetDItem
  1351. ItemHandle    ds.l    1    ;Handle of Dialog Item
  1352. DispRect    ds.l    2    ;Rect of Dialog Item
  1353.  
  1354. ResHand        ds.l    1    ;Handle of a 'help' resource
  1355.  
  1356. ResId        ds.w    1    ;Vars used by _GetResInfo ID#
  1357. ResType        ds.l    1    ;res. type
  1358. ResName        ds.b    256  ;res. name
  1359.  
  1360. ItemNumber    ds.w    1    ;Item# returned by _ModalDialog
  1361.  
  1362.     END
  1363.